#ifndef _GAMEDRAWER_
#define _GAMEDRAWER_
#include "SFML/Graphics.hpp"
#include "SpriteManager.hpp"
#include "Content/Map.hpp"
#include "Camera.hpp"


/** 
* Class currently used to draw gameplay specific content.
*/
class GameDrawer {
private:
    static GameDrawer* currentInstance;
    sf::RenderWindow* renderWindow;
public:

    int screenWidth;
    int screenHeight;

    int startTileX;
    int startTileY;

    int pixelOffsetX;
    int pixelOffsetY;
    
    int mapPixelOffsetX;
    int mapPixelOffsetY;
    
    GameDrawer();
    SpriteManager spriteManager;
    static GameDrawer * Instance();
    
    void setWindow(sf::RenderWindow* window);
    bool loadTextures();

    void calculateOffset(Camera* camera);
    
	void drawMapBackground(Map* map, Camera* camera);
	void drawMapForeground(Map* map, Camera* camera);
	
	void drawLayerProperties(Map* map, Camera* camera);
	void drawMapLayer(Map* map, Camera* camera, byte layer);
    ~GameDrawer();
};

#endif